package main

import (
	"fmt"
	"strings"
)

// 切割字符串的函数
// abc, b => [a c]
func Split(s, sep string) (result []string) {
	i := strings.Index(s, sep)

	for i > -1 {
		result = append(result, s[:i])
		s = s[i+1:]
		i = strings.Index(s, sep)
	}
	result = append(result, s)
	return
}

func main() {
	arr := Split("asdfaafa", "f")
	fmt.Println(arr)
}
